home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Revista CD Expert 8
/
Revista CD Expert nº 08 CD1.iso
/
Utilitarios
/
Programacao
/
Pacific C for DOS
/
EXAMPLES
/
EXITFUNC.C
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-08
|
807b
|
23 lines
#include <stdlib.h>
#include <conio.h>
static void
exitfunc(void)
{
cputs("\n\n*** THIS IS EXITFUNC ***\n\n");
}
main()
{
atexit(exitfunc);
cputs("exitfunc() will be automatically executed when this program terminates.\n");
cputs("The atexit() function is specified in the ANSI standard, and is guaranteed\n");
cputs("to work with any conforming version of C. You can use atexit() to install\n");
cputs("a cleanup function which will make sure your application exits properly\n");
cputs("even in abnormal situations. For example, if you have your own interrupt\n");
cputs("handler on a vector, you can use atexit() to make sure the vector is restored\n");
cputs("and the interrupt is disabled when your program exits.\n");
cputs("\nPress any key to exit: ");
getch();
}